package demo.bocweb.login_module.api;

import demo.bocweb.com.sdk.base.bean.BaseBean;
import demo.bocweb.login_module.bean.LoginBean;
import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.PATCH;
import retrofit2.http.POST;

/**
 * Created by zhelun on 2018/1/26.
 */

public interface UserApi {


    /**
     * 登录
     *
     * @param body
     * @return
     */
    @POST(UserModelUrl.login)
    Observable<BaseBean<LoginBean>> login(@Body RequestBody body);

    /**
     * 短信验证码登录
     *
     * @param body
     * @return
     */
    @POST(UserModelUrl.quickLogin)
    Observable<BaseBean<LoginBean>> quickLogin(@Body RequestBody body);

    /**
     * 发送短信验证码
     *
     * @param body
     * @return
     */
    @POST(UserModelUrl.sendSmsCode)
    Observable<BaseBean> sendSmsCode(@Body RequestBody body);

    /**
     * 注册
     *
     * @param body
     * @return
     */
    @POST(UserModelUrl.register)
    Observable<BaseBean<LoginBean>> register(@Body RequestBody body);

    /**
     * 效验短信验证码
     *
     * @param body
     * @return
     */
    @POST(UserModelUrl.checkSmsCode)
    Observable<BaseBean> checkSmsCode(@Body RequestBody body);

    /**
     * 找回密码
     *
     * @param body
     * @return
     */
    @PATCH(UserModelUrl.findPwd)
    Observable<BaseBean> findPwd(@Body RequestBody body);

    /**
     * 修改密码
     *
     * @param body
     * @return
     */
    @PATCH(UserModelUrl.resetPwd)
    Observable<BaseBean> resetPwd(@Body RequestBody body);

    /**
     * 修改手机号
     *
     * @param body
     * @return
     */
    @PATCH(UserModelUrl.resetPhone)
    Observable<BaseBean> resetPhone(@Body RequestBody body);

}
